﻿Ext.define('I2R.view.memberselect', {
    extend: 'Ext.Window',
    alias: 'widget.i2rmemberselect',
    border: false,
    requires: ['Ext.ux.form.MultiSelect','Ext.ux.form.ItemSelector'],
    bodyCls: 'padd-up',
    initComponent: function () {

        var me = this;

        me.buttons = me.getButtons();
        me.items = me.getItems();

        me.callParent(arguments);
    },

    getItems: function () {

        var me = this;

        return [

            {
                xtype: 'form',
                bodyStyle: 'background-color: transparent',
                height: 350,
                border: false,
                items: [
                     {
                        id: 'memberselect-field',
                         xtype: 'itemselectorfield',
                         buttons: ['add', 'remove'],
                         height: 300,
                        anchor: '100%',
                        store:[[123,'One Hundred Twenty Three'],
    ['1', 'One'], ['2', 'Two'], ['3', 'Three'], ['4', 'Four'], ['5', 'Five'],
    ['6', 'Six'], ['7', 'Seven'], ['8', 'Eight'], ['9', 'Nine']],
                        displayField: 'text',
                        valueField: 'value',
                        value: ['3', '4', '6'],
                        allowBlank: false        
                    }
                ]
            }
        ];
    },

    getButtons: function () {

        var me = this;

        return [
            {
                text: 'Select', iconCls: 'icon_accept'
            },
            {
                text: 'Cancel', iconCls: 'icon_cancel', handler: function () {
                    me.hide();
                }
            }
        ];

    }
});